<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>无标题文档</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css" media="all" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css" />
  <script src="https://www.layuicdn.com/layui-v2.5.6/layui.js"></script>
</head>
<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li>采购管理</li>
    <li>厂商管理</li>
    <li>厂商详情</li>
  </ul>
</div>
<div class="formbody">
  <input name="id" id="id" type="text" class="layui-input" style="display: none"/>
  <div class="formtitle"><span>厂商信息</span></div>
  <div class="layui-form-item">
    <label class="layui-form-label">厂商名称</label>
    <div class="layui-input-inline" >
      <input name="name" id="name" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">负责人</label>
    <div class="layui-input-inline" >
      <input name="userPerson" id="userPerson" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">联系方式</label>
    <div class="layui-input-inline" >
      <input name="tel" id="tel" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">联系地址</label>
    <div class="layui-input-inline" >
      <input name="address" id="address" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">所属区域</label>
    <div class="layui-input-inline" >
      <input name="area" id="area" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">描述</label>
    <div class="layui-input-inline" >
      <textarea name="description" id="description" type="text" value="" readonly="readonly" class="layui-input" ></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline" >
      <input name="status" id="status" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">创建人</label>
    <div class="layui-input-inline" >
      <input name="createPerson" id="createPerson" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">创建时间</label>
    <div class="layui-input-inline" >
      <input name="createTime" id="createTime" type="text" value="" readonly="readonly" class="layui-input" />
    </div>
  </div>
</div>
<script type="text/javascript">
  layui.use(['table', 'form'], function () {
    var table = layui.table,
            form = layui.form,
            util = layui.util,
            $ = layui.jquery;
    $(function () {
      var parent_json = eval('(' + parent.json + ')');
      $("#id").val(parent_json.id);
      $.ajax({
        url: "/Firm/findFirmById?id=" + $("#id").val(),
        type: 'post',
        dataType: 'json',
        success: function (res) {
          var data = res;
          $("#name").val(data.name);
          $("#userPerson").val(data.userPerson);
          $("#tel").val(data.tel);
          $("#name").val(data.name);
          $("#address").val(data.address);
          $("#description").val(data.description);
          $("#area").val(data.province+data.city);
          if(data.status=="1"){
            $("#status").val("可用");
          }else {
            $("#status").val("不可用");
          }
          $("#createPerson").val(data.createPerson);
          $("#createTime").val(util.toDateString(data.createTime, "yyyy-MM-dd HH:mm:ss"));
        },
        error: function () {
          layer.msg('系统错误，请联系管理员', {icon: 5});
        }
      });
      form.render();
    });
  });
</script>
</body>
</html>
